package com.xoa.controller.party;


import com.xoa.model.party.EsPoliceStation;
import com.xoa.service.party.EsPoliceStationService;
import com.xoa.util.ToJson;
import com.xoa.util.common.newwrapper.BaseWrapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 巡逻警务站点
 * Created by gsb on 2018/1/11.
 */
@Controller
@RequestMapping("/esPoliceStation")
public class EsPoliceStationController {

    @Resource
    private EsPoliceStationService esPoliceStationService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:57:51
     * 类介绍  :  新建
     * 构造参数:
     *
     */
    @RequestMapping(value ="insertSelective")
    @ResponseBody
    public ToJson<EsPoliceStation> insertSelective(EsPoliceStation esPoliceStation, HttpServletRequest request, String gridLocation){
        return esPoliceStationService.insertSelective(esPoliceStation, request,gridLocation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:57:51
     * 类介绍  :  删除
     * 构造参数:
     *
     */
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<EsPoliceStation> deleteByPrimaryKey(Integer sid){
        return esPoliceStationService.deleteByPrimaryKey(sid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:57:51
     * 类介绍  :  修改
     * 构造参数:
     *
     */
    @RequestMapping(value ="updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<EsPoliceStation> updateByPrimaryKeySelective(EsPoliceStation esPoliceStation, String gridLocation){
        return esPoliceStationService.updateByPrimaryKeySelective(esPoliceStation,gridLocation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:57:51
     * 类介绍  :  详情
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectById")
    @ResponseBody
    public ToJson<EsPoliceStation> selectById(Integer sid){
        return esPoliceStationService.selectById(sid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:57:51
     * 类介绍  :  列表
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryList")
    @ResponseBody
    public ToJson<EsPoliceStation> queryList(EsPoliceStation esPoliceStation, Integer page, Integer pageSize,
                                             boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export){
        return esPoliceStationService.queryList(esPoliceStation, page, pageSize, useFlag, request, response, export);
    }

    @RequestMapping("/outPutFile")
    @ResponseBody
    public BaseWrapper outPutFile(HttpServletRequest request, HttpServletResponse response){
        return esPoliceStationService.outPutFile(request,response);
    }


}
